<%--
    Document   : update_lxdh
    Created on : 2016-3-14, 14:15:40
    Author     : zuotai
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
        <title>微信排号</title>
        <link rel="stylesheet" href="<c:url value="/shared/jquery-weui/weui.css" />"/>
        <link rel="stylesheet" href="<c:url value="/shared/jquery-weui/jquery-weui.css" />"/>
        <link rel="stylesheet" href="<c:url value="/shared/jquery-weui/example.css" />"/>
        <script type="text/javascript" src="<c:url value="/shared/jquery-weui/jquery-2.1.4.js"/>"></script>
        <script type="text/javascript" src="<c:url value="/shared/jquery-weui/jquery-weui.js"/>"></script>
        <script type="text/javascript" src="<c:url value="/js/global.js"/>"></script>
        <script type="text/javascript" src="<c:url value="/shared/frame/frame-weui-jquery.js"/>"></script>
        <style type="text/css">
            h2{
                font-size:24px;
                color:#FF0000;
            }
        </style>
        <script type="text/javascript">
            var api = ${jsapi != null ? jsapi : '{}'};    //js sdk 签名
            var sfyjph = '${isReturn.value}';
            $(function() {
                $('#phy2').on('click', function() {
                    if (sfyjph == "yes") {
                        $.alert("您已经排过号了，请不要重复排号", function() {
                            location.href = BaseUrl + 'wx/_page/ph/phd.do?service_code=S42006';
                        });
                    } else {
                        $.alert("您今日的微信排号次数已用完，如需办理业务请到业务大厅直接排号");
                    }
                });
                $('#phyl').on('click', function() {
                    if (sfyjph == "yes") {
                        $.alert("您已经排过号了，请不要重复排号", function() {
                            location.href = BaseUrl + 'wx/_page/ph/phd.do?service_code=S42006';
                        });
                    } else {
                        $.prompt("办理业务时请出示身份证作为排号依据，如果身份证姓名与输入姓名不同，则排号无效", "请输入身份证姓名进行排号", function(name) {
                            if (name != null && name != "") {
                                var o = new AjaxOptions();
                                o.put('ywlx', '${ywlx.value}');
                                o.put('xm', name);
                                o.put('service_code', 'P42005');
                                o.sus = function(data) {
                                    var msg = data.msg;
                                    if (msg == -1) {
                                        var warm = data.warm;
                                        $.alert(warm);
                                        location.href = BaseUrl + 'wx/_page/ph/phzy.do?service_code=S42001';
                                    } else {
                                        location.href = BaseUrl + 'wx/_page/ph/phd.do?service_code=S42006';
                                    }
                                };

                            } else {
                                $.alert("名字/车牌号不能为空");
                            }
                            $.ajax(o);
                        }, function() {
                            //取消操作
                        });
                    }
                });
            });

        </script>
    </head>
    <body>
        <c:if test="${!msg.value}">
            <div class="page">
                <div class="weui_msg">
                    <div class="weui_icon_area"><i class="weui_icon_warn weui_icon_msg"></i></div>
                    <div class="weui_text_area">
                        <h2 class="weui_msg_title">排号失败</h2>
                        <p class="weui_msg_desc">${info.value}</p>
                    </div>
                    <div class="weui_opr_area">
                        <p class="weui_btn_area">
                            <a href="<c:url value="/wx/_page/ph/phzy.do?service_code=S42101" />" class="weui_btn weui_btn_primary">返回</a>
                        </p>
                    </div>
                </div>
            </div>
        </c:if>
        <c:if test="${msg.value}">
            <div class="page" id="user-info-page">
                <div class="hd" align="center">
                    <h1 class="page_title">${ywmc.value}业务</h1>
                    <h2 class="page_title">排队人数</h2>
                    <h1 class="">${pdrs.value}</h1>
                    <h3>预估排队时间：<span style="color:red">${pdsj.value}</span>分钟</h3>
                    <div class="weui_btn_area" id="ph0">
                        <c:if test="${wxopen.value == '0'}">
                            <c:choose>
                                <c:when test="${timesInfo.value == 0}">
                                    <a id="phy2" class="weui_btn weui_btn_disabled weui_btn_primary" style="width:98%">排号</a>
                                </c:when>
                                <c:when test="${timesInfo.value == 1}">
                                    <a id="phyl" class="weui_btn weui_btn_primary" style="width:98%">排号</a>
                                </c:when>
                            </c:choose>
                        </c:if>
                    </div>
                    <div class="weui_cells_title">您今天还可以排<span style="color:red">${userTime.value}</span>次号</div>
                </div>
                <div class="weui_cells">
                    <div class="weui_cell">
                        <div class="weui_cell_bd weui_cell_primary">
                            <p>业务简介:</p>
                        </div>
                    </div>
                    <div class="weui_cell">
                        <div >${ywjj.value}</div>
                    </div>
                </div>
            </div>
        </c:if>
    </body>
</html>
